<?php
/**
 * 车源模块逻辑层
 */
namespace AuctionBack\Logic;

use AuctionBack\Model\CarSourceModel;
use AuctionCore\System\AuctionException;

class CarSourceLogic
{

    Protected $autoCheckFields = false;

    public $sid = null;

    /**
     * 构造
     *
     * @param  int $sid
     *
     */
    public function __construct($sid)
    {
        $this->sid = $sid;
    }

    /**
     *
     * @return array
     */
    public function detail()
    {
        return D('CarSource', 'Model')->where("sid='{$this->sid}'")->find();
    }

    /**
     * 更新车源
     *
     * @param array $info 要更新车源信息
     * @return boolean
     */
    public function update($info)
    {
        $map['sid'] = array('eq', $this->sid);
        return D('CarSource', 'Model')->where($map)->save($info);
    }


}